export enum DIMENSION {
  '默认维度' = 'sd',
  '切换维度' = 'ds',
}

export enum DIMENSION96 {
  '默认维度' = 'sdn',
  '切换维度' = 'ns',
}

export const FIRELOW = 394.9;

export const SORT = {
  desc: 'desc',
  asc: 'asc',
};

export const indexMap: any = {
  totalStatementQuantity: { name: '综合电量', type: 'bar', color: '#5795CD' },
  totalStatementEnergyPrice: {
    name: '综合电价',
    type: 'line',
    color: '#E6E963',
    props: {
      symbol: 'circle',
    },
  },
  _averagePrice: {
    name: '算术均价',
    type: 'dashed',
    color: '#F6925A',
    props: {
      symbol: 'circle',
    },
  },
  dayaheadForecastQuantity: { name: '日前电量', type: 'bar', color: '#28B2AA' },
  realtimeQuantity: { name: '实时电量', type: 'bar', color: '#67B2F7' },
  dayaheadPrice: {
    name: '日前电价',
    type: 'line',
    color: '#F6C826',
    props: {
      symbol: 'circle',
    },
  },
  realtimePrice: {
    name: '实时电价',
    type: 'line',
    color: '#837ADC',
    props: {
      symbol: 'circle',
    },
  },
  longTermPriceDifference: { name: '中长期价差', type: 'bar', color: '#56CCF2' },
  spotPriceDifference: { name: '现货价差', type: 'bar', color: '#E6E963' },
  kilowattHourPriceDifference: { name: '度电价差', type: 'bar', color: '#F6C826' },
  powerPredictionPriceDifference: {
    name: '功率预测价差',
    type: 'bar',
    color: '#2BDAE5',
    props: { stack: 'one' },
  },
  deviationRecoveryPriceDifference: {
    name: '偏差回收价差',
    type: 'bar',
    color: '#E6E963',
    props: { stack: 'one' },
  },
  _longTermStatementEnergyPrice: { name: '中长期收益', type: 'bar', color: '#468EF9' },
  _provincialDayaheadStatementPriceaheadStatementPrice: {
    name: '日前结算电价',
    type: 'bar',
    color: '#28B2AA',
  },
  _provincialRealtimeStatementPricetimeStatementPrice: {
    name: '实时结算电价',
    type: 'bar',
    color: '#28B2AA',
  },
  _totalLongTermStatementEnergyPrice: {
    name: '中长期收益度电提升',
    type: 'line',
    props: { symbol: 'circle' },
    color: '#2BDAE5',
  },
};
export const chartsMap = {
  场站总览: ['totalStatementQuantity', 'totalStatementEnergyPrice'],
  现货电量电价: ['dayaheadForecastQuantity', 'realtimeQuantity', 'dayaheadPrice', 'realtimePrice'],
  中长期收益分析: ['_longTermStatementEnergyPrice', '_totalLongTermStatementEnergyPrice'],
};

/**
 * 子页面
 * funcName //处理数据相应的方法
 * param //方法传入参数字段(字符串)
 * useData //是否依赖数据源 默认true
 * dependentValue  //依赖其他字段计算后的值
 */
export const chartsMap_subpage = {
  场站总览: {
    totalStatementQuantity: {
      funcName: 'forMater',
      param: ['totalStatementQuantity'],
    },
    totalStatementEnergyPrice: {
      funcName: 'forMater',
      param: ['totalStatementEnergyPrice'],
    },
    _averagePrice: {
      funcName: '_getTotalStatementEnergyPrice',
      param: ['totalStatementEnergyPrice'],
    },
  },
  现货电量电价: {
    provincialSpotStatementQuantityRatio: {
      funcName: 'forMater',
      param: ['provincialSpotStatementQuantityRatio'],
    },
    totalProvincialSpotStatementPrice: {
      funcName: 'forMater',
      param: ['totalProvincialSpotStatementPrice'],
    },
  },
  // 交易价差收益: {
  //   longTermPriceDifference: {
  //     funcName: 'forMater',
  //     param: ['longTermPriceDifference'],
  //   },
  //   spotPriceDifference: {
  //     funcName: 'forMater',
  //     param: ['spotPriceDifference'],
  //   },
  //   kilowattHourPriceDifference: {
  //     funcName: 'forMater',
  //     param: ['kilowattHourPriceDifference'],
  //   },
  // },
  // 考核价差收益: {
  //   powerPredictionPriceDifference: {
  //     funcName: 'forMater',
  //     param: ['powerPredictionPriceDifference'],
  //   },
  //   deviationRecoveryPriceDifference: {
  //     funcName: 'forMater',
  //     param: ['deviationRecoveryPriceDifference'],
  //   },
  // },
  中长期收益分析: {
    totalLongTermStatementEnergyPrice: {
      funcName: 'forMater',
      param: ['totalLongTermStatementEnergyPrice'],
    },
    longTermStatementEnergyPrice: {
      funcName: 'forMater',
      param: ['longTermStatementEnergyPrice'],
    },
    _provincialDayaheadStatementPriceaheadStatementPrice: {
      funcName: 'forMater',
      param: ['provincialDayaheadStatementPrice'],
    },
    _provincialRealtimeStatementPricetimeStatementPrice: {
      funcName: 'forMater',
      param: ['provincialRealtimeStatementPrice'],
    },
  },
};

/**
 * 子页面 场站-日期-96/24点数据
 * funcName //处理数据相应的方法
 * param //方法传入参数字段(字符串)
 * useData //是否依赖数据源 默认true
 * dependentValue  //依赖其他字段计算后的值
 */
export const chartsMap_subpage_isSDN = {
  场站总览: {
    totalStatementQuantity: {
      funcName: 'getEcharsData96',
      param: ['totalStatementQuantity', true],
    },
    totalStatementEnergyPrice: {
      funcName: 'getTotalStatementPrice',
    },
    _averagePrice: {
      funcName: 'getTotalStatementEnergyPrice',
      dependentValue: 'totalStatementEnergyPrice',
      useData: false,
    },
  },
  现货电量电价: {
    provincialSpotStatementQuantityRatio: {
      funcName: 'getPercentageSpotElectricity',
    },
    totalProvincialSpotStatementPrice: {
      funcName: 'getSpotElectricityPeice',
    },
  },
  // 交易价差收益: {
  //   longTermPriceDifference: {
  //     funcName: 'getMediumAndLongTermSpread',
  //   },
  //   spotPriceDifference: {
  //     funcName: 'getSpotPrice',
  //   },
  //   kilowattHourPriceDifference: {
  //     funcName: 'getDegreePrice',
  //   },
  // },
  // 考核价差收益: {
  //   powerPredictionPriceDifference: {
  //     funcName: 'getPowerForecastPrice',
  //     param: ['predictionEvaluation', 'totalStatementQuantity'],
  //   },
  //   deviationRecoveryPriceDifference: {
  //     funcName: 'getPowerForecastPrice',
  //     param: ['newEnergyRecycle', 'totalStatementQuantity'],
  //   },
  // },
  中长期收益分析: {
    totalLongTermStatementEnergyPrice: {
      funcName: 'getPowerForecastPrice',
      param: ['totalLongTermStatementEnergyIncome', 'totalLongTermStatementQuantity'],
    },
    longTermStatementEnergyPrice: {
      funcName: 'getPowerForecastPrice',
      param: ['longTermStatementEnergyIncome', 'longTermStatementQuantity'],
    },
    _provincialDayaheadStatementPriceaheadStatementPrice: {
      funcName: 'getPowerForecastPrice',
      param: ['provincialDayaheadStatementIncome', 'provincialDayaheadStatementQuantity'],
    },
    _provincialRealtimeStatementPricetimeStatementPrice: {
      funcName: 'getPowerForecastPrice',
      param: ['provincialRealtimeStatementIncome', 'provincialRealtimeStatementQuantity'],
    },
  },
};
//需要展示双Y轴的图表
export const Doubel_yAxis_title = ['场站总览', '现货电量电价'];

//需要展示双Y轴的serise字段
export const Doubel_yAxis_serise = [
  'totalStatementEnergyPrice',
  // '_averagePrice',
  // 'totalProvincialSpotStatementPrice',
  'dayaheadPrice',
  'realtimePrice',
];
export const SELECT_DATA: string[] = ['是否入市', '交易单元', '日期', '时点'];
export const tableHead = [
  {
    field: 'totalStatementEnergyIncome',
    name: '综合电费',
    parentName: '综合统计',
  },
  {
    field: 'totalStatementQuantity',
    name: '综合电量',
    parentName: '综合统计',
  },
  {
    field: 'totalStatementEnergyPrice',
    name: '综合电价',
    parentName: '综合统计',
  },
  {
    field: 'totalLongTermStatementEnergyIncome',
    name: '中长期电费',
    parentName: '中长期统计',
  },
  {
    field: 'totalLongTermStatementQuantity',
    name: '中长期电量',
    parentName: '中长期统计',
  },
  {
    field: 'totalLongTermStatementEnergyPrice',
    name: '中长期合约电价',
    parentName: '中长期统计',
  },
  {
    field: 'dayaheadIncome',
    name: '日前电费',
    parentName: '现货统计',
  },
  {
    field: 'dayaheadForecastQuantity',
    name: '日前预测电量',
    parentName: '现货统计',
  },
  {
    field: 'dayaheadPrice',
    name: '日前电价',
    parentName: '现货统计',
  },
  {
    field: 'dayaheadDiffIncome',
    name: '日前偏差电费',
    parentName: '现货统计',
  },
  {
    field: 'realtimeTariff',
    name: '实时电费',
    parentName: '现货统计',
  },
  {
    field: 'realtimeQuantity',
    name: '实时电量',
    parentName: '现货统计',
  },
  {
    field: 'realtimePrice',
    name: '实时电价',
    parentName: '现货统计',
  },
  {
    field: 'realtimeIncome',
    name: '实时偏差电费',
    parentName: '现货统计',
  },
  {
    field: 'passiveElectricityCostCalculation',
    name: '被动电费测算',
    parentName: '交易测算',
  },
  {
    field: 'passiveElectricityPriceCalculation',
    name: '被动电价测算',
    parentName: '交易测算',
  },
  {
    field: 'passiveBatteryRatio',
    name: '被动电量比例',
    parentName: '交易测算',
  },
  {
    field: 'fullSpotCalculation',
    name: '全现货测算',
    parentName: '交易测算',
  },
  {
    field: 'fullSpotAvgCalculation',
    name: '全现货均价测算',
    parentName: '交易测算',
  },
  {
    field: 'totalLongTermPosition',
    name: '中长期仓位损益',
    parentName: '交易测算',
  },
  {
    field: 'D1FullContractCalculation',
    name: 'D1全合约测算',
    parentName: '交易测算',
  },
  {
    field: 'D1FullContractCalculationAvg',
    name: 'D1全合约测算均价',
    parentName: '交易测算',
  },
];

/**
 * {key:value}
 */
export const headerMap = tableHead.reduce(
  (a: any, b) => {
    a[b.name] = b.field;
    return a;
  },
  //表格未展示字段
  { 装机容量: 'installedCapacity', 标杆电价: 'benchmarkElectricityPrice' },
);

export const marketMap = { 0: '被动入市', 1: '主动入市' };
export const marketOption = [
  { label: '主动入市', value: 1 },
  { label: '被动入市', value: 0 },
];
export const OPTION_KEY: Record<string, any> = {
  是否入市: 'market',
  交易单元: 'unit',
  日期: 'date',
  时点: 'timeOrder',
};
